<template>
    <main_header></main_header>
    <el-container>
        <el-container>
            <el-aside width="200px">
                <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose">
                    <el-sub-menu index="1">
                        <template #title>
                            <el-icon>
                                <location />
                            </el-icon>
                            <span>超级管理员</span>
                        </template>
                        <el-menu-item-group title="">
                            <el-menu-item v-for="i in menu_list" :index="`${i.id}`" @click="change_menu(i.path)">{{
                                i.name
                                }}</el-menu-item>
                        </el-menu-item-group>
                    </el-sub-menu>
                </el-menu>
            </el-aside>
            <el-main><router-view></router-view></el-main>
        </el-container>
    </el-container>
</template>

<script setup>
import main_header from '../../components/header.vue'
let router = useRouter()

import { ref, onMounted } from "vue"
import { useRouter } from 'vue-router'
let activeid = ref(1)
let menu_list = ref([{
    id: 1,
    name: '用户管理',
    path: '/user_manage'
}, {
    id: 2,
    name: '角色管理',
    path: '/role'
}, {
    id: 3,
    name: '权限管理',
    path: '/permission'
}
])
function change_menu(path) {
    router.push('/admin' + path)
}



</script>

<style scoped>
#navtop {
    background-color: #5fbfff;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

img {
    width: 50px;
    border-radius: 50px;
}

.logo {
    float: left;
}

.title {
    margin-left: 20px;
    text-align: center
}

.user {
    float: right;
}

.user span {
    color: #f5f5f5;
    font-size: 16px;
    line-height: 50px;
}

.user-info {
    display: inline-block;
    vertical-align: middle;
}

#main {
    width: calc(100% - 200px);
    height: 100vh;
    background-color: #f5f5f5;
    padding: 20px;
}

#aside {
    width: 200px;
    height: 100vh;
    background-color: #5fbfff;
    color: #fff;
}

#aside li {
    padding: 10px;
    list-style: none;
    cursor: pointer;
    border-bottom: 1px solid #fff;
    border-radius: 5px;
}

#aside li:hover {
    background-color: #fff;
    color: #5fbfff;
}

.selected {
    background-color: #fff;
    color: #5fbfff;
}
</style>